/**
 * 抽离出头部导航栏
 */

import React, {PureComponent} from 'react';
import {NavBar} from 'antd-mobile';
import './index.less';

export default class Index extends PureComponent {

  render() {
    const {title, mode, icon, bindLeftClick, style} = this.props;
    // dangerouslySetInnerHTML 转义实体
    return (
      <NavBar
        className='my-nav-bar'
        style={style}
        mode={mode}
        icon={<i className='iconfont'><span dangerouslySetInnerHTML={{__html: icon}}/></i>}
        onLeftClick={bindLeftClick}>{title}
      </NavBar>
    );
  }
}